﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace LL.Utility.WindowsForms
{
    public class MessageDialogHelper
    {
        public static void ShowInfomation(string message, string title = "信息", IWin32Window handler = null)
        {
            MessageBox.Show(handler, message, title, MessageBoxButtons.OK, MessageBoxIcon.Information);
        }

        public static void ShowError(string message, string title = "错误", IWin32Window handler = null)
        {
            MessageBox.Show(handler, message, title, MessageBoxButtons.OK, MessageBoxIcon.Error);
        }

        public static DialogResult ConfirmYesNoCancel(string message, string title = "请确认", IWin32Window handler = null)
        {
            return MessageBox.Show(handler, message, title,
                                   MessageBoxButtons.YesNoCancel, MessageBoxIcon.Question);
        }

        public static bool ConfirmYesNo(string message, string title = "请确认", IWin32Window handler = null)
        {
            return MessageBox.Show(handler, message, title,
                                   MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes;
        }
    }
}
